package com.boot.demo.controller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import java.text.DateFormat;
import java.util.Date;

/**
 * Description
 *
 * @author qinyonghui
 * @date 2019/12/3 17:49
 */
@Controller
public class ShowController {

    @RequestMapping(value = "/helloJsp",method = RequestMethod.GET)
    public String list(HttpServletRequest request, Model model){
        model.addAttribute("nowTime", DateFormat.getDateTimeInstance().format(new Date()));
        return "test";
    }

    @RequestMapping("/")
    public String index(){
        return "index";
    }

    @RequestMapping("/testhtml")
    public String testhtml(){
        return "test";
    }
}
